package com.hualan.service;

import com.hualan.domain.Consultwait;
import com.hualan.mapper.ConsultwaitMapper;
import com.hualan.util.R;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class ConsultwaitService {
    @Autowired
    private ConsultwaitMapper consultwaitMapper;

    //通过userid和状态 查询全部咨询
    public R selectAllConsultWait(int userId , int status){
        List<Consultwait> list=consultwaitMapper.selectAllConsultwait(userId,status);
        if (list==null){
            return R.fail(200);
        }else {
            return R.success(list);
        }
    }



    public int deleteByPrimaryKey(Long id) {
        return consultwaitMapper.deleteByPrimaryKey(id);
    }


    public int insert(Consultwait record) {
        return consultwaitMapper.insert(record);
    }


    public int insertSelective(Consultwait record) {
        return consultwaitMapper.insertSelective(record);
    }


    public Consultwait selectByPrimaryKey(Long id) {
        return consultwaitMapper.selectByPrimaryKey(id);
    }


    public int updateByPrimaryKeySelective(Consultwait record) {
        return consultwaitMapper.updateByPrimaryKeySelective(record);
    }


    public int updateByPrimaryKey(Consultwait record) {
        return consultwaitMapper.updateByPrimaryKey(record);
    }
}
